<!--#include file="Config.asp" -->
<!--#include file="HeadTop.asp"-->

<%
intID=int(Request("id"))
ActionType=Trim(Request("ActionType"))
SaveType=Trim(Request("SaveType"))
set rs=server.createobject("adodb.recordset")
set rss=server.createobject("adodb.recordset")
msg=request("msg")



if SaveType="ModOK" then
sql="select * from plan_calendar where id="&intID&" and UserID="&session("AnyPIM_userID")
rs.open sql,conn,1,3
rs("calendarText")=Trim(Request("content"))
rs("UserID")=session("AnyPIM_userID")
rs("calendartitle")=Trim(Request("title"))
rs("calendarFlag")=Trim(Request("calendarFlag"))
rs("calendarFinType")=Trim(Request("calendarFinType"))
rs("calendarRight")=Trim(Request("calendarRight"))
rs("calendarMPlan")=Trim(Request("calendarMPlan"))
rs("calendarSort")=int(Request("calendarsort"))
rs("calendarHour")=Trim(Request("calendarHour"))
rs.Update
rs.close
msg="修改成功！"
end if

sql="select * from plan_calendar where id="&intID&" and UserID="&session("AnyPIM_userID")
rs.open sql,conn,1,1
strdate=trim(rs("calendarDate"))
title=trim(rs("calendarTitle"))
text=trim(rs("calendarText"))
Flag=trim(rs("calendarFlag"))
FinType=trim(rs("calendarFinType"))
PRight=trim(rs("calendarRight"))
calendarMPlan=Int(rs("calendarMPlan"))
calendarHour=Int(rs("calendarHour"))
calendarSort=Int(rs("calendarSort"))
rs.close

AName="填写完整，提交修改"
URL_This="?SaveType=ModOK&ID="&intID

%>


<br />
<TABLE class="table table-condensed">
<TR>
<form method="post" action="<%=URL_This%>" name="form1">
<TD valign='top'>
<!-- main ///////////////////////////////////////////////////////////////////////////////////////////-->
<table class="table table-condensed">
<TR>
<TD align='right'>时间：</TD>
<TD>
<INPUT TYPE="text" value="<%=strdate%>" readonly style="background-color: #FFCC33;">
<SELECT NAME="calendarHour">
<%For ch=WT_begin To WT_End%><OPTION VALUE="<%=ch%>" <%If calendarHour=ch then%>SELECTED<%End if%>><%=ch%>点</option>
 <%next%></SELECT>
 <SELECT NAME="calendarSort">
<%
SQL="select * from Plan_sort order by ID"
rss.open sql,conn,1,1
For ss=1 To rss.recordcount
%>
<OPTION VALUE="<%=rss("id")%>" <%If calendarSort=int(rss("id"))then%>SELECTED<%End if%>><%=trim(rss("title"))%></OPTION>
<%
rss.moveNext
next
rss.close
%>
</SELECT>
</TD>
</tr>
<TR>
<TD align='right'>事件标题：</TD>
<TD>
<INPUT TYPE="text" NAME="title" value='<%=title%>' size='60'  >
</TD>
</tr>
<TR>
<TD align='right'>事件内容：</TD>
<TD>
<!--  HTML编辑器 eWebEditor V9.20精简版引用------------->
<textarea name="content" style="display:none" id="content" ><%=text%></textarea>
<IFRAME ID="eWebEditor1" src="_Editor/ewebeditor.asp?id=content&style=s_exampleremote" FRAMEBORDER="0" scrolling="no" width="90%" HEIGHT="350"></iframe>
<!--  HTML编辑器 eWebEditor V9.20精简版引用------------->

</TD>
</tr>
<TR>
<TD align='right'>所为目标：</TD>
<TD>
<SELECT NAME="calendarMPlan">
<%
'月度目标
SQL="select * from Plan_target where '"&strdate&"' between T_begin_time and T_End_time and T_Father_ID=0 and UserID='"&session("AnyPIM_userID")&"' order by T_ID"
rs.open sql,conn,1,1
For Y=1 To rs.recordcount
%>
<optgroup label="<%=y%>.<%=Trim(rs("T_Title"))%>">
<%
SQL2="select * from Plan_target where '"&strdate&"' between T_begin_time and T_End_time and T_Father_ID="&int(rs("T_ID"))&" and UserID='"&session("AnyPIM_userID")&"' order by T_ID"
rss.open sql2,conn,1,1
For YS=1 To rss.recordcount
%>
<OPTION VALUE="<%=int(rss("T_ID"))%>" style= "background:<%=ShowFlagColor(trim(rss("T_Flag")))%>" <%If calendarMPlan=int(rss("T_ID")) Then %>selected<%End if%>><%=y%>.<%=ys%>.<%=Trim(rss("T_Title"))%></OPTION>
<%
rss.moveNext
next
rss.close
%>
</optgroup>
<%
rs.moveNext
next
rs.close
%>
</SELECT>
优先级：

<SELECT NAME="calendarFlag">
	<OPTION VALUE="2" <%if int(Flag)=2 then%>SELECTED<%end if%>>重要不紧急</option>
	<OPTION VALUE="1" <%if int(Flag)=1 then%>SELECTED<%end if%>>重要且紧急</option>
	<OPTION VALUE="3" <%if int(Flag)=3 then%>SELECTED<%end if%>>不重要且紧急</option>
	<OPTION VALUE="4" <%if int(Flag)=4 then%>SELECTED<%end if%>>不重要不紧急</option>

</SELECT>
完成程度：
<SELECT NAME="calendarFinType">
<%For Fi=10 To 0 Step -1%>
<OPTION VALUE="<%=Fi%>"  <%if int(FinType)=Fi then%>SELECTED<%end if%>><%=10*Fi%>%</option>
<%next%>
</SELECT>
 权限：
<SELECT NAME="calendarRight">
	<OPTION VALUE="2" <%if int(Pright)=2 then%>SELECTED<%end if%>>公开</option>
	<OPTION VALUE="1" <%if int(Pright)=1 then%>SELECTED<%end if%>>私人</option>
</SELECT>
</TD>
</tr>
</TABLE>


<%
'AnyPIM_Free_Right权限检测
If session("AnyPIM_RightEdit")=1 then
%>
<br>
<CENTER><INPUT TYPE="SUBMIT" VALUE="<%=AName%>">
<INPUT TYPE="reset">
<FONT color="#ff0000"><B><%=msg%></B></FONT>
<%End if%>
</TD>
</FORM>
<!-- Right /////////////////////////////////////////////////////////////////////////-->
<TD valign='top' width='250'>
<!-- 今日信息开始 -->
<!-- #include file="IncEventTodayMsg.asp" -->
<!-- 今日信息结束 -->
<!-- 月历开始 -->
<!-- #include file="IncEventMonth.asp" -->
<!-- 月历结束 -->

<!-- 期间目标和安排 -->
<!-- #include file="IncEventObjective.asp" -->
<!-- 期间目标和安排 -->
</TD>
</TR>
</TABLE>

<!-- #include file="foot.asp" -->
